package com.comboo.example.web.exception;

/**
 * @author Sherman
 * created in 2018/12/19
 */

public class ServiceException extends RuntimeException {


    private String message;

    private ErrorType errorType;

    public ServiceException() {
        this(ErrorType.UNKNOW_ERROR, null);
    }

    public ServiceException(ErrorType errorType) {
        this(errorType, null);
    }

    public ServiceException(String message) {
        this(ErrorType.SERVICE_ERROR, message);
    }

    public ServiceException(ErrorType errorType, String message) {
        super(message);
        this.errorType = errorType;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public ErrorType getErrorType() {
        return errorType;
    }

    public void setErrorType(ErrorType errorType) {
        this.errorType = errorType;
    }
}
